<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="jt" uri="http://www.jsoft.org/tags/jsoft"%>
<%@ taglib prefix="jh" uri="http://www.jsoft.org/tags/jsoft-html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	if(path!=null&&path.equals("/")){
	   path="";
	} 
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>上传新文件</title>
		<link href="<%=basePath%>admin/styles/default.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath%>admin/styles/page.css" rel="stylesheet" type="text/css" />
		<script type=text/javascript src="<%=basePath%>admin/scripts/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
		function form_delete(href)
		{
			if(confirm("您确定要删除吗？执行删除后数据将无法恢复！"))
			{
   				window.location.href = href;
   			}
		}
		</script>
	</head>

	<body>
		<div class="title">
			<h2>
				上传新文件
				<a href="<%=basePath%>manager/file/list.do">返回列表</a>
			</h2>
		</div>
		<div id="container">
			<!-- table -->
			<div id="info">
				<form action="<%=basePath%>manager/file/save.do" method="post" enctype="multipart/form-data">
					<input type="hidden" name="id" value="${requestScope.news.id}" >
					<table width="100%" cellpadding="3" cellspacing="1" border="0" bgcolor="#e3e3e3">
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">类目</td>
							<td>
								<select name="cid">
									<option value="">-请选择-</option>
									<c:forEach items="${requestScope.categorys}" var="category">
									<c:if test="${category.pid eq 0}">
									<option value="${category.id}" ${(requestScope.file.cid eq category.id)?'selected=selected':''}><c:out value="${category.name}"/></option>
									<c:forEach items="${requestScope.categorys}" var="cate_1">
									<c:if test="${cate_1.pid eq category.id}">
									<option value="${cate_1.id}" ${(requestScope.file.cid eq cate_1.id)?'selected=selected':''}>|-<c:out value="${cate_1.name}"/></option>
									<c:forEach items="${requestScope.categorys}" var="cate_2">
									<c:if test="${cate_2.pid eq cate_1.id}">
									<option value="${cate_2.id}" ${(requestScope.file.cid eq cate_2.id)?'selected=selected':''}>　|-<c:out value="${cate_2.name}"/></option>
									<c:forEach items="${requestScope.categorys}" var="cate_3">
									<c:if test="${cate_3.pid eq cate_2.id}">
									<option value="${cate_3.id}" ${(requestScope.file.cid eq cate_3.id)?'selected=selected':''}>　　|-<c:out value="${cate_3.name}"/></option>
									</c:if>
									</c:forEach>
									</c:if>
									</c:forEach>
									</c:if>
									</c:forEach>
									</c:if>
									</c:forEach>
								</select>
							</td>
						</tr>
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">标题</td>
							<td>
								<input type="text" name="title" value="${requestScope.file.title}" size="60" class="text" />
							</td>
						</tr>
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">文件</td>
							<td>
								<input type="file" name="file" size="60" class="text" />
							</td>
						</tr>
						<tr bgcolor="#FFFFFF">
							<td width="100" nowrap="nowrap" bgcolor="#f7fbff">备注</td>
							<td>
								<textarea rows="5" cols="50" name="info"><c:out value="${requestScope.file.info}"/></textarea>
							</td>
						</tr>
					</table>
					<div style="height: 10px;"></div>
					<input type="submit" value="提交" class="button" />
					<input type="reset" value="重置" class="button" />
					<div style="height: 10px;"></div>
				</form>
			</div>
		</div>
	</body>
</html>
